<template>
    <div>
        <h1>用户</h1>
        <hr />
        count:{{ $store.state.user.count }}
        <hr />
        count10:{{ $store.getters['user/count10'] }}
        <hr />
      
        <button @click="handlerAddCount">+1 mutations</button>
        &nbsp; &nbsp;
        <button @click="handlerAddCountN">+N mutations</button>
        &nbsp; &nbsp;
        <button @click="handlerAddCountAction">+1 action</button>
        &nbsp; &nbsp;
        <button @click="handlerAddCountActionN">+N action</button>

    </div>
</template>

<script>
export default {
    methods:{
        handlerAddCountAction() {
            this.$store.dispatch('user/addCountAction')
        },
        handlerAddCountActionN() {
            this.$store.dispatch('user/addCountActionN',{
                a:10,
                b:20
            })
        },
        handlerAddCount() {
            // 用户下的addCount
            this.$store.commit("user/addCount")
           

        },
        handlerAddCountN() {
            this.$store.commit('user/addCountN',{
                a:10,
                b:20
            })
        }
    }
};
</script>

<style>

</style>
